package com.sanxiang.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sanxiang.common.CommonResult;
import com.sanxiang.entity.EnterpriseTable;
import com.sanxiang.mapper.EnterpriseTableMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/enterprise")
public class EnterpriseController {
    @Resource
    private EnterpriseTableMapper enterpriseTableMapper;

    @GetMapping()
    public CommonResult selectEnterpriseList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "5") Integer pageSize) {
        Page<EnterpriseTable> page = new Page<>(pageNum, pageSize);
        enterpriseTableMapper.selectPage(page, null);
        return CommonResult.success(page);
    }
}
